import {
  Controller,
  Get,
  Query,
  Post,
  Body,
  Put,
  Param,
  Delete,
  Bind,
} from '@nestjs/common';
import { CatsService } from './cats.service';

@Controller('cats')
export class CatsController {
  constructor(private catsService: CatsService) {}
  @Get('msg')
  getMsg() {
    return `This action returns msg`;
  }
  @Get()
  findAll() {
    return this.catsService.findAll();
  }
  @Get(':id')
  findOne(@Param('id') id: string) {
    return `This action returns a #${id} cat`;
  }
  @Post('add')
  @Bind(Body())
  create(createCatDto) {
    return this.catsService.create(createCatDto);
  }
  @Put(':id')
  update(@Param('id') id: string, @Body() updateCatDto) {
    return this.catsService.update(id, updateCatDto);
  }
  @Delete(':id')
  remove(@Param('id') id: string) {
    return this.catsService.remove(id);
  }
}
